package com.example.demo.rest.ecom;

import com.example.demo.api.ecom.LoyaltyApi;
import com.example.demo.bean.vo.LoyaltyJoin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoyaltyController {
    @Autowired
    LoyaltyApi loyaltyApi;

    @GetMapping("loyaltyInfo")
    public Object loyaltyInfo(@RequestParam("country") String country, @RequestParam("language") String language, @RequestParam("userId") String userId, @RequestParam("storeId") String storeId) {
        return loyaltyApi.loyaltyInfo(country, language, userId, storeId);
    }

    @GetMapping("loyaltyUpdateProfile")
    public Object loyaltyUpdateProfile(@RequestBody LoyaltyJoin loyaltyJoin) {
        return loyaltyApi.loyaltyUpdateProfile(loyaltyJoin);
    }

    @GetMapping("enrollLoyalty")
    public Object enrollLoyalty(@RequestParam("country") String country, @RequestParam("language") String language, @RequestParam("loyaltyJoin") LoyaltyJoin loyaltyJoin) {
        return loyaltyApi.enrollLoyalty(country, language, loyaltyJoin);
    }

    @GetMapping("enrollLoyaltyByStore")
    public Object enrollLoyaltyByStore(@RequestBody LoyaltyJoin loyaltyJoin) {
        return loyaltyApi.enrollLoyaltyByStore(loyaltyJoin);
    }

    @GetMapping("syncALCUserInfoToHybris")
    public Object syncALCUserInfoToHybris() {
        return loyaltyApi.syncALCUserInfoToHybris();
    }


}
